package com.study.example.gameserver.module.backpack.entity;

import com.sparrow.example_message.backpack.vo.ItemVo;

import java.io.Serializable;

public class Item implements Serializable {
    private static final long serialVersionUID = 1L;
    private long id;
    private int index;
    private int modelId;
    private int num;

    public void setIndex(int index) {
        this.index = index;
    }

    public int getIndex() {
        return index;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public int getModelId() {
        return modelId;
    }

    public void setModelId(int modelId) {
        this.modelId = modelId;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public void addNum(int num) {
        this.num += num;
    }

    public ItemVo toItemVo() {
        ItemVo vo = new ItemVo();
        vo.setId(id);
        vo.setIndex(index);
        vo.setModelId(modelId);
        vo.setNum(num);
        return vo;
    }

}
